package com.zoo.diannaopeijian.controller.export;

import com.zoo.diannaopeijian.controller.BaseController;
import com.zoo.diannaopeijian.service.SysService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.annotation.Resource;

/**
 * Created by zx583 on 2018-02-04.
 */
@Controller
@RequestMapping("/sys")
public class SysController extends BaseController {
    @Resource
    private SysService sysService;

    @RequestMapping("/updateLogo")
    @ResponseBody
    public String updateLogo(@RequestParam("logoUpload") MultipartFile logoUpload) {
        System.out.println(1);
        return sysService.updateLogo(logoUpload) ? success : fail;
    }

    @RequestMapping("/updateName")
    @ResponseBody
    public String updateName(String sysname) {
        return sysService.updateSysName(sysname) ? success : fail;
    }

    @RequestMapping("/getSysName")
    @ResponseBody
    public String getSysName() {
        return sysService.getSysName();
    }
}
